package com.jielin.handling.entity.auditrecorder;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jielin.handling.bean.base.BaseSearch;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AuditRecoder extends BaseSearch {
    private String id;

    private String auditId;

    private  String  drawerCode;

    private String accessPoliceCode;

    private String transCode;

    private String handleUnitCode;

    private String accessPoliceName;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date entryDate;//入库时间
    private String outPoliceName;

    private String outPoliceCode;

    private String borrowName;

    private String borrowCode;

    private String borrowReason;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date borrowDate;//出庫時間

    private String transferName;

    private String transferCode;

    private String transfeReason;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date transferDate;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date returnDate;

    private String policeCode;

    private String policeName;

    private String suspectId;
    private String returnPoliceName;//归还民警姓名
    private String returnPoliceCode;//归还民警警号
    private String caseCode;
    private String caseName;
    private String accessLibrary;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date creatDate;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date modifyDate;

    private  String borrowNameCode;

    private String outNameCode;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private String  dayTime;

    private String transferPoliceName;
    private String transferPoliceCode;
    private String transferNameAndCode;

    private String suspectNameAndId;//嫌疑人名称和身份证后四位

    private  String  name;

    private  String isNew;//是否是最新记录

    private String causesAndTypes;//借阅原因种类

    private String transferCauseAndType;//移交原因种类

    private String   idValue;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date startDate;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private  Date  endDate;

    @Override
    public void setQueryCondition(JSONObject queryCondition) {
        this.auditId=queryCondition.getString("auditId");
        this.caseCode=queryCondition.getString("caseCode");
        this.idValue=queryCondition.getString("idValue");
        this.caseName=queryCondition.getString("caseName");
        this.transferCode=queryCondition.getString("transferCode");
        this.startDate=queryCondition.getDate("startDate");
        this.endDate=queryCondition.getDate("endDate");
        this.handleUnitCode=queryCondition.getString("handleUnitCode");
    }
}